import 'package:flutter/material.dart';

import '../../../helper/utils/util.dart';
import '../controller.dart';

class PersonRecordWidget extends GetView<MeController> {
  const PersonRecordWidget({Key? key}) : super(key: key);

  Widget _buildItem({
    required String val,
    required String key,
    VoidCallback? onTap,
  }) {
    return MenuItemView(
      onTap: onTap,
      icon: Text(
        val,
        style: TextStyle(color: Colors.white, fontSize: 22.sp),
      ),
      title: Text(
        key,
        style: TextStyle(color: const Color(0xaaffffff), fontSize: 15.sp),
      ),
      spacing: 2,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 80.r,
      decoration: BoxDecoration(
          color: const Color(0xff3A67F4),
          borderRadius: BorderRadius.circular(3),
          boxShadow: [
            BoxShadow(
                color: const Color(0xff3A67F4).withAlpha(80),
                offset: const Offset(1, 2)),
            BoxShadow(
                color: const Color(0xff3A67F4).withAlpha(30),
                offset: const Offset(3, 4)),
            BoxShadow(
                color: const Color(0xff3A67F4).withAlpha(5),
                offset: const Offset(5, 6)),
          ]),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          _buildItem(val: '0', key: '关注', onTap: controller.goFocus),
          _buildItem(val: '0', key: '足迹', onTap: controller.goFootprint),
          _buildItem(val: '0', key: '收藏', onTap: controller.goCollect),
        ],
      ),
    );
  }
}
